﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true"
    CodeBehind="ProdutosLista.aspx.cs" Inherits="welwitschia.Produtos.ProdutosLista" %>

<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
   
        <div id="header" class="info">
            <h2>
                Lista de Produtos</h2>
        </div>
        <div>
            <asp:TextBox ID="txtPesquisaProduto" runat="server"></asp:TextBox>
            <asp:DropDownList ID="ddlPesquisaGrupoProduto" runat="server"></asp:DropDownList>
            <asp:Button ID="btnPesquisa" runat="server" Text="Pesquisar" onclick="btnPesquisa_Click" />
        </div>
    <div>
                <asp:ListView runat="server" ID="ListView" DataKeyNames="IdProduto" OnItemDeleting="ListView1_ItemDeleting"
                    OnItemEditing="ListView1_ItemEditing" 
                    OnItemCommand="ListView1_ItemCommand" 
                    onpagepropertieschanging="ListView_PagePropertiesChanging">
                    <LayoutTemplate>
                         <table runat="server" class="grd2" id="table1">
                <thead>
                     <tr class="ghdr2">
                    
                            <td>
                                Produto ID
                            </td>
                            <td>
                                Nome
                            </td>
                            <td>
                                Descrição
                            </td>
                            <td>
                                Unidade Medida
                            </td>
                            <td>
                                Preço
                            </td>
                            <td>
                                Moeda
                            </td>
                             <td>
                                Familia
                            </td>
                       
                     <td>
                        &nbsp;
                     </td>
                     </tr>
                </thead>
                <tr runat="server" id="itemPlaceholder">
                </tr>
            </table>
                    </LayoutTemplate>
                    <ItemTemplate>
                        
                        <tr id="Tr1" class='grd2<%#Container.DataItemIndex % 2 %>' >
                            <td id="Td1" runat="server">
                                <%-- Data-bound content. --%>
                                <asp:Label ID="Label1" runat="server" Text='<%#Eval("IdProduto") %>' />
                            </td>
                            <td id="Td2" runat="server">
                                <%-- Data-bound content. --%>
                                <asp:Label ID="NameLabel" runat="server" Text='<%#Eval("Nome") %>' />
                            </td>
                            <td id="Td4" runat="server">
                                <%-- Data-bound content. --%>
                                <asp:Label ID="Label2" runat="server" Text='<%#Eval("Descricao") %>' />
                            </td>
                            <td id="Td5" runat="server">
                                <%-- Data-bound content. --%>
                                <asp:Label ID="Label3" runat="server" Text='<%#Eval("UnidadeMedida.Descricao") %>' />
                            </td>
                            <td id="Td6" runat="server">
                                <%-- Data-bound content. --%>
                                <asp:Label ID="Label4" runat="server" Text='<%#Eval("PrecoCusto") %>' />
                            </td>
                            <td id="Td7" runat="server">
                                <%-- Data-bound content. --%>
                                <asp:Label ID="Label5" runat="server" Text='<%#Eval("Moeda.Descricao") %>' />
                            </td>
                             <td id="Td8" runat="server">
                                <%-- Data-bound content. --%>
                                <asp:Label ID="Label6" runat="server" Text='<%#Eval("GrupoProduto.Descricao") %>' />
                            </td>
                            <td id="Td3" runat="server">
                                <%-- Data-bound content. --%>
                                <asp:LinkButton ID="EditButton" CommandName="Edit" CommandArgument='<%# Eval("IdProduto")%>'
                                    runat="server" Text="Editar"></asp:LinkButton>
                                <asp:LinkButton ID="DeleteButton" OnClientClick="return confirm('Quer Apagar registo?');"
                                    CommandName="Delete" CommandArgument='<%# Eval("IdProduto")%>' runat="server" Text="Apagar"></asp:LinkButton>
                            </td>
                        </tr>
                    </ItemTemplate>
                </asp:ListView>
                <div class="pagination-clean">
            <asp:DataPager ID="dplvProduto" runat="server" PagedControlID="ListView"
                PageSize="20">
                <Fields>
                    <asp:NextPreviousPagerField ButtonCssClass="command" FirstPageText="« Anterior" PreviousPageText="« Anterior"
                        RenderDisabledButtonsAsLabels="false" ShowFirstPageButton="false" ShowPreviousPageButton="true"
                        ShowLastPageButton="false" ShowNextPageButton="false" RenderNonBreakingSpacesBetweenControls="False" />
                    <asp:NumericPagerField CurrentPageLabelCssClass="current" NextPreviousButtonCssClass="next"
                        RenderNonBreakingSpacesBetweenControls="False" />
                    <asp:NextPreviousPagerField ButtonCssClass="command" LastPageText="›" NextPageText="Seguinte »"
                        RenderDisabledButtonsAsLabels="false" ShowFirstPageButton="false" ShowPreviousPageButton="false"
                        ShowLastPageButton="false" ShowNextPageButton="true" RenderNonBreakingSpacesBetweenControls="False" />
                </Fields>
            </asp:DataPager>
        </div>

           </div>
           <div class="pageCommandArea">
                    <asp:Button ID="Button1" runat="server" Text="Criar Produto" OnClick="Unnamed1_Click" /></div>
</asp:Content>
